package com.longshihan.module_toutiao.http;
/*
 * Copyright (C) 2016 Johnny Shieh Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import com.longshihan.module_toutiao.mvp.model.entity.FunnyData;
import com.longshihan.module_toutiao.mvp.model.entity.GanHuoData;
import com.longshihan.module_toutiao.mvp.model.entity.GankData;
import com.longshihan.module_toutiao.mvp.model.entity.MeiziData;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Path;

/**
 * The Http Api of Gank
 *
 * @author Johnny Shieh
 * @version 1.0
 */
public interface GankService {


    // http://gank.io/api/data/数据类型/请求个数/第几页
    @Headers({"url_name:toutiao"})
    @GET(value = "data/福利/" + GankApi.MEIZI_SIZE + "/{page}")
    Observable<MeiziData> getMeiziData(@Path("page") String page);

    @Headers({"url_name:toutiao"})
    @GET("data/休息视频/" + GankApi.MEIZI_SIZE + "/{page}")
    Observable<FunnyData> getFunnyData(@Path("page") int page);

    //请求某天干货数据
    @Headers({"url_name:toutiao"})
    @GET("day/{year}/{month}/{day}")
    Observable<GankData> getDailyData(
            @Path("year") int year,
            @Path("month") int month,
            @Path("day") int day);

    //请求不同类型干货（通用）
    @Headers({"url_name:toutiao"})
    @GET("data/{type}/" + GankApi.GANK_SIZE + "/{page}")
    Observable<GanHuoData> getGanHuoData(@Path("type") String type, @Path("page") int page);

}
